package com.zerous.framework;

public class Animation
{
	Pixmap[] ani;
	int i = 0, fpe = 10, count;
	public Animation(Pixmap... p)
	{
		ani = p;
	}
	
	public Animation setFPE(int f)
	{
		fpe = f;
		return this;
	}
	
	public void draw(int x, int y)
	{
		if(count % fpe == 0)
		{
			if(i < ani.length - 1)
			{
				i++;
			}
			else
			{
				i = 0;
			}
		}
		Zex.graphics.drawPixmap(ani[i], x, y, 255);
		++count;
	}
}
